from django.shortcuts import render
from django.views.generic import TemplateView
from django.views.decorators.csrf import ensure_csrf_cookie

class DashboardView(TemplateView):
    """主控制台视图"""
    template_name = 'main/base.html'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context['page_title'] = '云平台管理系统'
        return context

@ensure_csrf_cookie
def home(request):
    """首页视图"""
    return render(request, 'main/base.html', {
        'page_title': '云平台管理系统 - 首页'
    })
